package top.lilele.adminSystem.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * @author lilele
 */
@Data
@TableName(value = "admin_space")
public class AdminSpaceEntity implements Serializable {

    /**
     * id
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 标题
     */
    @NotEmpty(message = "标题不能为空")
    @Length(message = "标题名称限制50个字符", max = 50)
    @TableField(value = "title")
    private String title;

    /**
     * 内容
     */
    @TableField(value = "content")
    private String content;

    /**
     * 类型  1 文件夹  2 excel文档
     */
    @TableField(value = "type")
    @NotNull(message = "type不能为空")
    private Integer type;

    /**
     * 父元素id
     */
    @TableField(value = "parentId")
    private String parentId;

    /**
     * 创建人id
     */
    @TableField(value = "createdId")
    private String createdId;

    /**
     * 更新人id
     */
    @TableField(value = "updatedId")
    private String updatedId;

    @TableField(value = "createdTime", fill = FieldFill.INSERT)
    private Date createdTime;
    @TableField(value = "updatedTime", fill = FieldFill.UPDATE)
    private Date updatedTime;
}
